import QtQuick 1.0

QMLTwitterBase{
    id: _root

    //////////////////////////////////////////////////////////
    // properties


    //////////////////////////////////////////////////////////
    // changed


    //////////////////////////////////////////////////////////
    // signals

    signal responseHomeTimeline(string text)
    signal responseMentions(string text)
    signal responsePublicTimeline(string text)
    signal responseRetweetedByMe(string text)
    signal responseRetweetedToMe(string text)
    signal responseRetweetedOfMe(string text)
    signal responseUserTimeline(string text)
    signal responseRetweetedToUser(string text)
    signal responseRetweetedByUser(string text)


    //////////////////////////////////////////////////////////
    // methods

    function homeTimeline(count, since_id, max_id, page, trim_user
                          , include_rts, include_entities, exclude_repies
                          , contributor_details ){
        var content = {};
        if(!isNullOrEmpty(count)){
            content.count = count;
        }
        if(!isNullOrEmpty(since_id)){
            content.since_id = since_id;
        }
        if(!isNullOrEmpty(max_id)){
            content.max_id = max_id;
        }
        if(!isNullOrEmpty(page)){
            content.page = page;
        }
        if(!isNullOrEmpty(trim_user)){
            content.trim_user = trim_user;
        }
        if(!isNullOrEmpty(include_rts)){
            content.include_rts = include_rts;
        }
        if(!isNullOrEmpty(include_entities)){
            content.include_entities = include_entities;
        }
        if(!isNullOrEmpty(exclude_repies)){
            content.exclude_repies = exclude_repies;
        }
        if(!isNullOrEmpty(contributor_details)){
            content.contributor_details = contributor_details;
        }
        // リクエスト
        requestAPI("GET", "URL_TIMELINES_HOME_TIMELINE"
                   , content, responseHomeTimeline);
    }

    function mentions(count, since_id, max_id, page, trim_user
                      , include_rts, include_entities
                      , contributor_details){
        var content = {};
        if(!isNullOrEmpty(count)){
            content.count = count;
        }
        if(!isNullOrEmpty(since_id)){
            content.since_id = since_id;
        }
        if(!isNullOrEmpty(max_id)){
            content.max_id = max_id;
        }
        if(!isNullOrEmpty(page)){
            content.page = page;
        }
        if(!isNullOrEmpty(trim_user)){
            content.trim_user = trim_user;
        }
        if(!isNullOrEmpty(include_rts)){
            content.include_rts = include_rts;
        }
        if(!isNullOrEmpty(include_entities)){
            content.include_entities = include_entities;
        }
        if(!isNullOrEmpty(contributor_details)){
            content.contributor_details = contributor_details;
        }

        // リクエスト
        requestAPI("GET", "URL_TIMELINES_MENTIONS"
                   , content, responseMentions);
    }

    function publicTimeline(trim_user, include_entities){
        var content = {};
        if(!isNullOrEmpty(trim_user)){
            content.trim_user = trim_user;
        }
        if(!isNullOrEmpty(include_entities)){
            content.include_entities = include_entities;
        }
        // リクエスト
        requestAPI("GET", "URL_TIMELINES_PUBLIC_TIMELINE"
                   , content, responsePublicTimeline);
    }


    function retweetedByMe(count, since_id, max_id, page, trim_user
                                   , include_entities){
        var content = {};
        if(!isNullOrEmpty(count)){
            content.count = count;
        }
        if(!isNullOrEmpty(since_id)){
            content.since_id = since_id;
        }
        if(!isNullOrEmpty(max_id)){
            content.max_id = max_id;
        }
        if(!isNullOrEmpty(page)){
            content.page = page;
        }
        if(!isNullOrEmpty(trim_user)){
            content.trim_user = trim_user;
        }
        if(!isNullOrEmpty(include_entities)){
            content.include_entities = include_entities;
        }

        // リクエスト
        requestAPI("GET", "URL_TIMELINES_RETWEETS_BY_ME"
                   , content, responseRetweetedByMe);
    }

    function retweetedToMe(count, since_id, max_id, page, trim_user
                                   , include_entities){
        var content = {};
        if(!isNullOrEmpty(count)){
            content.count = count;
        }
        if(!isNullOrEmpty(since_id)){
            content.since_id = since_id;
        }
        if(!isNullOrEmpty(max_id)){
            content.max_id = max_id;
        }
        if(!isNullOrEmpty(page)){
            content.page = page;
        }
        if(!isNullOrEmpty(trim_user)){
            content.trim_user = trim_user;
        }
        if(!isNullOrEmpty(include_entities)){
            content.include_entities = include_entities;
        }

        // リクエスト
        requestAPI("GET", "URL_TIMELINES_RETWEETS_TO_ME"
                   , content, responseRetweetedToMe);
    }

    function retweetedOfMe(count, since_id, max_id, page, trim_user
                                   , include_entities){
        var content = {};
        if(!isNullOrEmpty(count)){
            content.count = count;
        }
        if(!isNullOrEmpty(since_id)){
            content.since_id = since_id;
        }
        if(!isNullOrEmpty(max_id)){
            content.max_id = max_id;
        }
        if(!isNullOrEmpty(page)){
            content.page = page;
        }
        if(!isNullOrEmpty(trim_user)){
            content.trim_user = trim_user;
        }
        if(!isNullOrEmpty(include_entities)){
            content.include_entities = include_entities;
        }

        // リクエスト
        requestAPI("GET", "URL_TIMELINES_RETWEETS_OF_ME"
                   , content, responseRetweetedOfMe);
    }

    function userTimeline(user_id, screen_name
                                  , count, since_id, max_id, page, trim_user
                                  , include_rts, include_entities, exclude_repies
                                  , contributor_details){
        var content = {};
        if(!isNullOrEmpty(user_id)){
            content.user_id = user_id;
        }
        if(!isNullOrEmpty(screen_name)){
            content.screen_name = screen_name;
        }
        if(!isNullOrEmpty(count)){
            content.count = count;
        }
        if(!isNullOrEmpty(since_id)){
            content.since_id = since_id;
        }
        if(!isNullOrEmpty(max_id)){
            content.max_id = max_id;
        }
        if(!isNullOrEmpty(page)){
            content.page = page;
        }
        if(!isNullOrEmpty(trim_user)){
            content.trim_user = trim_user;
        }
        if(!isNullOrEmpty(include_rts)){
            content.include_rts = include_rts;
        }
        if(!isNullOrEmpty(include_entities)){
            content.include_entities = include_entities;
        }
        if(!isNullOrEmpty(exclude_repies)){
            content.exclude_repies = exclude_repies;
        }
        if(!isNullOrEmpty(contributor_details)){
            content.contributor_details = contributor_details;
        }

        // リクエスト
        requestAPI("GET", "URL_TIMELINES_USER_TIMELINE"
                   , content, responseUserTimeline);

    }

    function retweetedToUser(){

    }

    function retweetedByUser(){

    }

}
